import java.math.*;

public class Triangle {
    public int firstEdge;
    public int secondEdge;
    public int thirdEdge;

    public void squaring() {
        if ((firstEdge + secondEdge > thirdEdge) && (thirdEdge + secondEdge > firstEdge)
                && (firstEdge + thirdEdge > secondEdge)) {
                    System.out.println(firstEdge +","+ secondEdge +","+  thirdEdge + "这三条边能构成一个三角形");
            int p = (firstEdge + secondEdge + thirdEdge) / 2;
            double area = Math.sqrt(p * (p - firstEdge) * (p - secondEdge) * (p - thirdEdge));
            System.out.println("三角形的面积是：" + area);
        } else {
            System.out.println(firstEdge +","+ secondEdge +","+  thirdEdge + "这三条边不能构成一个三角形");
        }
    }

    public static void main(String[] args) {
        Triangle t = new Triangle();
        t.firstEdge = 30;
        t.secondEdge = 40;
        t.thirdEdge = 50;
        t.squaring();
    }
}